package dao;

import java.util.List;
import modele.Article;
import org.hibernate.Session;
import persistence.BaseDAO;

public class ArticleDAO{
	
	public static void ajouterArticle(Article article, Session session) throws Exception{
		BaseDAO.getInstance().ajouter(article,session);
		System.out.println("okoko");
	}

	public static void modifierArticle(Article article, Session session) {
		BaseDAO.getInstance().modifier(article,session);
	}

	public static void SupprimerArticle(Article article, Session session) {
		BaseDAO.getInstance().delete(article,session);
	}

	public static Article getArticle(int id, Session session) {
		return (Article)BaseDAO.getInstance().getObject(Article.class, id,session);
	}

	public static List getListeArticles(String requette, Session session) {
		return BaseDAO.getInstance().getListObject(requette,session);
	}
	public static List getListeArticles(String requette, Session session,int firstResult,int maxResults) {
		return BaseDAO.getInstance().getLimitedListObject(requette,firstResult,maxResults,session);
	}
}